<template>
	<div class="common-layout" style="height: 100%;">
		<el-container style="height: 100%;">
			<el-header style="height:5% ;">
				<h1 style="color: red;">还价查询</h1>
				<div><audio controls="controls" hidden src="./mp3/tip6.mp3" id="audio" ref="audio">不支持audio</audio>
				</div>
			</el-header>
			<el-main style="height:80% ;">
				<div style="height:100% ;">
					<el-row style="height:100% ;">
						<el-col :span="24">
							<el-table v-loading="loading" :data="tableData" style="width: 100%;" height="100%"
								:row-class-name="tableRowClassName" @sort-change="sortChange"
								:default-sort="{ prop: 'dt', order: '' }">
								<el-table-column label="头像" width="160">
									<template #default="scope">
										<div style="vertical-align: middle;">
											<p style="height: 38px;">
												<el-link href="javascript:void(0);" @click="openMobileWindow(scope.row)">
												<img alt=""
													v-bind:src="'./images/avators/' + avatorMaps[scope.row.yl3]"
													style="width: 25px;height: 25px">&nbsp;
													</el-link>
											</p>
											<p>

												<el-link href="javascript:void(0);" @click="openWindow(scope.row)"
													type="primary"
													style="font-size: 14px;line-height: 25px;margin-top: -16px;">
													{{scope.row.nickName}}</el-link>

											</p>

										</div>
									</template>

								</el-table-column>
								<el-table-column prop="areaName" label="服务器" width="170" />
								<el-table-column label="门派">
									<template #default="scope">
										{{scope.row.school}}
										<br />

										{{scope.row.level}}级
									</template>
								</el-table-column>
								<el-table-column prop="price" label="售价" width="120">
									<template #default="scope">
										<p>当前：{{scope.row.price}}</p>
										<p style="margin-top: 2px;">上次：{{scope.row.lastPrice}}</p>
										<p style="margin-top: 2px;" title="物品比列">物比：{{scope.row.goodsLiv}}%</p>
									</template>
								</el-table-column>
								<el-table-column prop="downPrice" label="定金还价" width="80">
									<template #default="scope">
										<el-tag type="success">{{scope.row.downPrice}}</el-tag>
									</template>
								</el-table-column>
								<el-table-column prop="refusePrice" label="最高拒绝" width="80">
									<template #default="scope">
										<el-tag type="warning">{{scope.row.refusePrice}}</el-tag>
									</template>
								</el-table-column>
								<el-table-column label="时间" :sortable="'custom'" prop="dt" width="220">

									<template #default="scope">
										<p>上架：{{scope.row.sellingTime}}</p>
										<p style="margin-top: 2px;">变动：{{scope.row.priceTime}}</p>
										
									</template>

								</el-table-column>

								<el-table-column prop="expt" label="修炼" />
								<el-table-column prop="basePrice" label="价格" width="110">
									<template #default="scope">
										<p>角色：{{scope.row.basePrice}}</p>
										<p style="margin-top: 2px;">装备：{{scope.row.equipPrice}}</p>
										<p style="margin-top: 2px;">宝宝：{{scope.row.summonPrice}}</p>
										
									</template>
								</el-table-column>

								<el-table-column label="价比" width="120">
									<template #default="scope">
										<p>性价比:{{(scope.row.lilv * 100).toFixed(0)}}%</p>
										<p>评估价:{{scope.row.priceTotal}}</p>
										<p>状态:<span v-if="scope.row.isHot == 3">已售出</span>
												<span v-else-if="scope.row.isHot == 4">已取回</span>
												<span v-else>上架中</span>
										</p>
									</template>
								</el-table-column>
								<el-table-column prop="hPrice" label="历史价">
									<template #default="scope">
										<span
											:title="scope.row.hPrice">{{scope.row.hPrice && scope.row.hPrice.length > 0 && scope.row.hPrice.indexOf(',') >0 ?scope.row.hPrice.substring(0,scope.row.hPrice.indexOf(',')) + '...':scope.row.hPrice}}</span>
									</template>
								</el-table-column>
								<el-table-column v-if="showMonitor" prop="monitorStatus" label="监控状态">
									<template #default="scope">
										<span v-if="scope.row.monitorStatus == '1'" > 监控中</span>
										<span v-else> 未监控</span>
				
									</template>
								</el-table-column>
								<el-table-column label="操作">
									<template #default="scope">
										<el-button size="small"
											type="success" :link="scope.row.mobileLink"
											:data="JSON.stringify(scope.row)" @click="copy2" target="_blank">复制
										</el-button>
										<el-button v-if="scope.row.showBtn == '1'" @click="monitorDialog(scope.row)"
											size="small" type="warning" icon="BellFilled">监控</el-button>
									</template>
								</el-table-column>
							</el-table>


						</el-col>

						<el-col :span="24">
							<el-pagination v-model:current-page="queryParam.current" v-model:page-size="queryParam.size"
								:page-sizes="[100, 200, 300, 400]" :size="queryParam.size" :background="true"
								layout="total, sizes, prev, pager, next, jumper" :total="queryParam.total"
								@size-change="handleSizeChange" @current-change="handleCurrentChange" />
						</el-col>

					</el-row>


				</div>

				<div>
					<el-dialog v-model="monitorDialogVisible" title="监控" width="600px">
						<div>
							<el-descriptions class="margin-top" title="角色信息" :column="2" :size="size" border>
								<el-descriptions-item>
									<template #label>
										<div class="cell-item">
											<el-icon>
												<user />
											</el-icon>
											角色名称
										</div>
									</template>
									<img alt="" v-bind:src="'./images/avators/' + avatorMaps[monitorRole.yl3]"
										style="width: 25px;height: 25px">&nbsp;
									<el-link href="javascript:void(0);" @click="openWindow(monitorRole)" type="primary"
										style="font-size: 14px;line-height: 25px;margin-top: -16px;">
										{{monitorRole.nickName}}</el-link>
								</el-descriptions-item>
								<el-descriptions-item>
									<template #label>
										<div class="cell-item">
											<el-icon>
												<iphone />
											</el-icon>
											服务器名称
										</div>
									</template>
									{{monitorRole.areaName}}
								</el-descriptions-item>
								<el-descriptions-item>
									<template #label>
										<div class="cell-item">
											<el-icon>
												<Coin />
											</el-icon>
											定金还价
										</div>
									</template>
									{{monitorRole.downPrice}}
								</el-descriptions-item>
								<el-descriptions-item>
									<template #label>
										<div class="cell-item">
											<el-icon>
												<Coin />
											</el-icon>
											最高拒绝
										</div>
									</template>
									{{monitorRole.refusePrice}}
								</el-descriptions-item>
								<el-descriptions-item>
									<template #label>
										<div class="cell-item">
											<el-icon>
												<Coin />
											</el-icon>
											当前售价
										</div>
									</template>
									{{monitorRole.price}}
								</el-descriptions-item>
								<el-descriptions-item>
									<template #label>
										<div class="cell-item">
											<el-icon>
												<Coin />
											</el-icon>
											上次售价
										</div>
									</template>
									{{monitorRole.lastPrice}}
								</el-descriptions-item>
								<el-descriptions-item>
									<template #label>
										<div class="cell-item">
											<el-icon>
												<office-building />
											</el-icon>
											备注信息
										</div>
									</template>
									<el-input v-model="monitorRole.remark" type="textarea" />
								</el-descriptions-item>
							</el-descriptions>

						</div>
						<template #footer>
							<div class="dialog-footer">
								<el-button @click="monitorDialogVisible = false">取消</el-button>
								<el-button type="primary" @click="addMonitor">
									确认
								</el-button>
							</div>
						</template>
					</el-dialog>




					<el-dialog v-model="monitorLinkDialogVisible" title="链接监控" width="600px">

						<el-form :model="form" label-width="auto" style="max-width: 600px">

							<el-form-item label="角色链接">
								<el-input v-model="form.link" type="textarea" />
							</el-form-item>

						</el-form>
						<template #footer>
							<div class="dialog-footer">
								<el-button @click="monitorLinkDialogVisible = false">取消</el-button>
								<el-button type="primary" @click="monitorLinkQuery">
									确认
								</el-button>
							</div>
						</template>
					</el-dialog>
				</div>
			</el-main>
			<el-footer>
				<div style="position: fixed;bottom: 10px;width: 100%;">
					<el-row>
						<el-col :span="3" style="text-align: right;">
							

						</el-col>
						<el-col :span="2">
					
						</el-col>
						<el-col :span="12">

						</el-col>
						<el-col :span="7">
							<el-button type="success" @click="searchDrawerChange">筛选</el-button>
							
							<el-button type="success" @click="loadDatas">刷新</el-button>

							<el-button type="warning" @click="openMonitorPage">监控历史</el-button>

							<el-tooltip class="item" effect="dark" content="快捷键(shift+c)" placement="top">
								<el-button type="warning" @click="monitorLinkDialogVisible=true">监控</el-button>
							</el-tooltip>
						</el-col>
					</el-row>
				</div>
				<div>
					<el-drawer v-model="monitorTableDrawer" title="监控历史" direction="btt" size="80%">
						<el-table :data="monitorData" height="450">
							<el-table-column label="头像" width="160">
								<template #default="scope">
									<div style="vertical-align: middle;">
										<img alt="" v-bind:src="'./images/avators/' + avatorMaps[scope.row.yl3]"
											style="width: 25px;height: 25px">&nbsp;
										<el-link href="javascript:void(0);" @click="openWindow(scope.row)"
											type="primary" style="font-size: 14px;line-height: 25px;margin-top: -16px;">
											{{scope.row.nickName}}</el-link>
									</div>
								</template>

							</el-table-column>
							<el-table-column property="downPrice" label="定金还价" />
							<el-table-column property="refusePrice" label="最高拒绝" />
							<el-table-column property="remark" label="备注" />
							<el-table-column property="latestDynamic" label="最新消息" />
							<el-table-column label="操作">
								<template #default="scope">

									<el-button @click="removeMonitor(scope.row)" size="small" type="warning">删除
									</el-button>
									<el-button type="primary" size="small"
										@click="monitorEditDialog(scope.row)">修改</el-button>

								</template>
							</el-table-column>
						</el-table>
						<el-pagination v-model:current-page="monitorQueryParam.current"
							v-model:page-size="monitorQueryParam.size" :page-sizes="[100, 200, 300, 400]"
							:size="monitorQueryParam.size" :background="true"
							layout="total, sizes, prev, pager, next, jumper" :total="monitorQueryParam.total"
							@size-change="handleMonitorSizeChange" @current-change="handleMonitorCurrentChange" />


						<el-dialog v-model="monitorEditDialogVisible" title="修改监控" width="600px">
							<div>
								<el-descriptions class="margin-top" title="角色信息" :column="1" :size="size" border>
									<el-descriptions-item>
										<template #label>
											<div class="cell-item">
												<el-icon>
													<user />
												</el-icon>
												角色名称
											</div>
										</template>
										<img alt="" v-bind:src="'./images/avators/' + avatorMaps[monitorEditRole.yl3]"
											style="width: 25px;height: 25px">&nbsp;
										<el-link href="javascript:void(0);" @click="openWindow(monitorEditRole)"
											type="primary" style="font-size: 14px;line-height: 25px;margin-top: -16px;">
											{{monitorEditRole.nickName}}</el-link>
									</el-descriptions-item>

									<el-descriptions-item>
										<template #label>
											<div class="cell-item">
												<el-icon>
													<office-building />
												</el-icon>
												备注信息
											</div>
										</template>
										<el-input v-model="monitorEditRole.remark" type="textarea" />
									</el-descriptions-item>
								</el-descriptions>

							</div>
							<template #footer>
								<div class="dialog-footer">
									<el-button @click="monitorEditDialogVisible = false">取消</el-button>
									<el-button type="primary" @click="editMonitor">
										确认
									</el-button>
								</div>
							</template>
						</el-dialog>
					</el-drawer>


			<el-drawer
			  title="筛选条件"
			  v-model="searchDrawer"
			  direction="btt">
				<el-row>
					<el-col :span="4">
						<el-input style="width: 170px;" placeholder="名称|服务器"  v-model="queryParam.keywords"></el-input>
					</el-col>
				
					<el-col :span="1">
						<el-checkbox-group text-color="white" fill="#67C23A"
							v-model="queryParam.first" @change="typeChange">
							<el-checkbox-button label="首次" value="01"></el-checkbox-button>
						</el-checkbox-group>
			
					</el-col>
					<el-col :span="17">
						<el-input style="width: 100px;" v-model="queryParam.goodsLiv" v-number-input.int
							placeholder="物品比列"></el-input>
				
											<el-input style="width: 80px;margin-left: 5px;" v-model="queryParam.startPrice" v-number-input.int
												placeholder="低价"></el-input>
											-
											<el-input style="width: 80px;" v-model="queryParam.endPrice" v-number-input.int
												placeholder="高价"></el-input>
											<el-input style="width: 80px;margin-left: 10px;" v-model="queryParam.startLevel"
												v-number-input.int placeholder="低级"></el-input>
											-
											<el-input style="width: 80px;" v-model="queryParam.endLevel" v-number-input.int
												placeholder="高级"></el-input>
											<el-input style="width: 80px;margin-left: 10px;" v-model="queryParam.startPercent"
												v-number-input.int placeholder="低性价"></el-input>
											-
											<el-input style="width: 80px;margin-right: 10px;" v-model="queryParam.endPercent"
												v-number-input.int placeholder="高性价"></el-input>
											<el-select style="width: 120px;" clearable v-model="queryParam.type" placeholder="分类" @change="typeChange">
												
												<el-option key="01" label="定金还价" value="01">
												</el-option>
												<el-option key="02" label="最高拒绝" value="02">
												</el-option>
												<el-option key="03" label="定金差10%" value="03">
												</el-option>
												<el-option key="04" label="定金差20%" value="04">
												</el-option>
												<el-option key="05" label="最高拒绝差10%" value="05">
												</el-option>
												<el-option key="06" label="最高拒绝差20%" value="06">
												</el-option>
						
											</el-select>
											<!-- 	<el-radio-group v-model="queryParam.type" size="medium" @change="typeChange">
												<el-radio-button label="01">定金还价</el-radio-button>
												<el-radio-button label="02">最高拒绝</el-radio-button>
												<el-radio-button label="03">定金差10%</el-radio-button>
												<el-radio-button label="04">定金差20%</el-radio-button>
												<el-radio-button label="05">最高拒绝差10%</el-radio-button>
												<el-radio-button label="06">最高拒绝差20%</el-radio-button>
											</el-radio-group> -->
										<el-select style="margin-left: 5px;width: 180px;" v-model="queryParam.monitor" clearable placeholder="状态" @change="typeChange">
											
												<el-option key="01" label="检查范围内" value="01">
												</el-option>
												<el-option key="02" label="监控范围内" value="02">
												</el-option>
											</el-select>
								
					</el-col>
					<el-col :span="2">
						<el-button @click="loadDatas" type="primary">确定</el-button>
					</el-col>
				</el-row>
			</el-drawer>
				</div>
			</el-footer>
		</el-container>
	</div>

</template>

<script>
	import Vue from 'vue';
	import emitter from '../mitt.js'
	import Api3 from "../api/api3.js"
	import Api from "../api/api.js"
	import DataConfig from "../config/DataConfig.js"
	import LinkUtil from '../util/link.js'
	import {
		ElMessage,
		ElNotification
	} from 'element-plus'
	import {
		h,
		ref
	} from 'vue'

	export default {
		name: 'Home',
		components: {},
		data() {
			return {
				timer1:null,
				timer2:null,
				showMonitor: false,
				"playRadio": true,
				"monitorEditDialogVisible": false,
				"monitorLinkDialogVisible": false,
				"form": {
					"link": null
				},
				"searchDrawer":false,
				"monitorTableDrawer": false,
				"monitorRole": {},
				"monitorEditRole": {},
				"monitorDialogVisible": false,
				"avatorMaps": DataConfig.avators,
				"loading": false,
				"tableData": [],
				"monitorData": [],
				"queryParam": {
					"isHot":[],
					"type": "",
					"first": [],
					"monitor":'01',
					"size": 100,
					"current": 1,
					"total": 0,
					"sortBy": "dt",
					"sortMethod": "",
				},
				"monitorQueryParam": {
					"keywords": "",
					"size": 100,
					"current": 1,
					"total": 0
				}
			}
		},
		created() {
			let _this = this;
			
			let queryParam = localStorage.getItem('queryParam');
			if(queryParam && queryParam.length>0){
				this.queryParam = JSON.parse(queryParam);
				this.queryParam.sortMethod = "";
			}
			
			_this.loadDatas();
			setTimeout(function() {
					_this.checkDataBaseNormal()
				_this.timer1 = setInterval(_this.checkDataBaseNormal
						, 20 * 60 * 1000
						//, 20*1000
					);
				}
				//,5*60*1000
				, 5 * 1000
			)

			_this.timer2 = setInterval(function() {
				_this.loadMessages()
			}, 30000)

			//setTimeout(this.playAudio,5000)
			//  let msg = {authCode:"uhbujn",createTime:"2025-03-22 11:20:26",eid:"202503211200113-730-LRGSN3IKXLF4",id:"1903285613302484000",link:"https://xyq.cbg.163.com/cgi-bin/equip_detail.py?&s=null&eid=202503211200113-730-LRGSN3IKXLF4",message:"定金还价发生变动: 30500.1 -> 30511.0",mobileLink:"http://xyq-m.cbg.163.com/cgi/mweb/equip/null/202503211200113-730-LRGSN3IKXLF4",name:"何不上九霄．",remark:"金戈铁马化圣五庄2.8",send:true};
			// this.$notify({
			//          title: '监控消息提醒',

			//          dangerouslyUseHTMLString: true,
			//          message: `<h4>角色 ${msg.name}</h4><h5>跳转：  <a href="${msg.link}" target="_blank" type="primary">电脑</a>  <a href="${msg.mobileLink}" type="success" target="_blank">手机</a></h5> <h5> 备注：${msg.remark} </h5> <h5> 监控消息: ${msg.message}</h5>`
			//        });
			// 页面即将卸载时，强制清除所有定时器
			window.addEventListener("beforeunload", () => {
				clearInterval(_this.timer1);
				clearInterval(_this.timer2);
			});
		},
		mounted() {
			window.addEventListener('keyup', this.handleGlobalKey);
		},
		methods: {
			searchDrawerChange(){
				this.searchDrawer = !this.searchDrawer;
			},
			handleGlobalKey(e) {
				// 层级1: 基础功能
				if (e.shiftKey == true && e.keyCode === 67) {
					this.monitorLinkDialogVisible = true
				}


			},
			sortChange(data) {

				this.queryParam.sortBy = data.prop
				this.queryParam.sortMethod =data.order !='' ? (data.order == 'ascending' ? "asc" : "desc"):data.order;
				this.loadDatas()
			},
			playAudio() {
				console.log("1")
				if (this.$refs.audio) {
					console.log("2")
					this.$refs.audio.currentTime = 0; //从头开始播放提示音
					this.$refs.audio.play(); //播放
					console.log("3")
				}

			},
			monitorLinkQuery() {
				let _this = this;
				if (_this.form.link == null || _this.form.link.length <= 0) {
					ElMessage({
						message: '请输入正确的链接.',
						type: 'error',
					});
					return;
				}
				Api3.queryByLink(_this.form).then(data => {
					_this.monitorDialog(data);
					_this.monitorLinkDialogVisible = false;
					_this.form.link = null;
				})
			},
			getQueryVariable(url, paramName) {
				url = url.substring(url.indexOf("?"));
				let paramValue = "",
					isFound = !1;
				if (url.indexOf("?") == 0 && url.indexOf("=") > 1) {
					let arrSource = unescape(url).substring(1, url.length).split("&"),
						i = 0;
					while (i < arrSource.length && !isFound) arrSource[i].indexOf("=") > 0 && arrSource[i].split("=")[0]
						.toLowerCase() == paramName.toLowerCase() && (paramValue = arrSource[i].split("=")[1], isFound = !
							0), i++
				}
				return paramValue == "" && (paramValue = null), paramValue
			},
			monitorEditDialog(row) {
				//console.log(JSON.stringify(row))
				this.monitorEditRole = row;
				this.monitorEditDialogVisible = true;
			},
			editMonitor(row) {
				let _this = this;
				Api3.bargainMonitorEdit(_this.monitorEditRole).then(body => {
					_this.monitorEditDialogVisible = false
					ElMessage({
						message: '修改成功.',
						type: 'success',
					})
					_this.loadMonitor()
				})
			},
			removeMonitor(row) {
				let _this = this;
				Api3.bargainMonitorRemove({
					"id": row.id
				}).then(body => {
					ElMessage({
						message: '删除成功.',
						type: 'success',
					});

					_this.loadMonitor();
				})
			},
			openMonitorPage() {
				this.loadMonitor();
			},
			addMonitor() {
				let _this = this;
				_this.monitorRole.eidId = _this.monitorRole.id
				_this.monitorRole.authCode = atob(localStorage.getItem("uuu"));
				_this.monitorRole.name = _this.monitorRole.nickName;
				_this.monitorRole.serverId = _this.getQueryVariable(_this.monitorRole.link, 's');
				// console.log(_this.monitorRole)
				Api3.bargainMonitor(_this.monitorRole).then(body => {
					_this.monitorDialogVisible = false
					ElMessage({
						message: '监控成功.',
						type: 'success',
					})
					_this.loadDatas()
				})

			},
			loadMonitor() {
				let _this = this;
				_this.monitorQueryParam.authCode = atob(localStorage.getItem("uuu"));
				Api3.bargainMonitorPage(_this.monitorQueryParam).then(body => {
					_this.monitorTableDrawer = true;
					_this.monitorData = body.records;
				})
			},
			loadMessages() {
				let param = {};
				let _this = this;
				param.type = "bargain_role";
				param.authCode = atob(localStorage.getItem("uuu"));
				Api3.messagesAll(param).then(body => {

					if (body && body.length > 0) {
						//console.log("0")
						_this.playAudio();
						for (var i = 0; i < body.length; i++) {
							// this.$notify({
							// 	duration:0,
							// 	title: '消息提醒',
							// 	message: h('i', {
							// 		style: 'color: teal'
							// 	}, body[0].message)
							// });
							let msg = body[i]

							this.$notify({
								duration: 0,
								title: '监控消息提醒',
								dangerouslyUseHTMLString: true,
								message: `<h4>角色 ${msg.name}</h4><h5>跳转：  <a href="${msg.link}" target="_blank" type="primary">电脑</a>  <a href="${msg.mobileLink}" type="success" target="_blank">手机</a></h5> <h5> 备注：${msg.remark} </h5> <h5> 监控消息: ${msg.message}</h5>`
							});

						}
					}
				});

			},
			tableRowClassName(
				scope,
			) {
				//console.log(scope.row)
				if (scope.row.look) {
					return "read-row"
				}

				// if (row.rowIndex %4 === 1) {
				// 	return 'warning-row'
				// } else if (row.rowIndex %4 === 3) {
				// 	return 'success-row'
				// }
				return ''
			},
			monitorDialog(row) {
				this.monitorRole = row;
				this.monitorDialogVisible = true;
			},
			eidToPcLink(eid) {
				return LinkUtil.eidToPcLink(eid);
			},
			loadDatas() {
				let _this = this
				let query = _this.queryParam;
				query.authCode = atob(localStorage.getItem("uuu"));
				_this.loading = true;
				//console.log(JSON.stringify(query));
				localStorage.setItem("queryParam",JSON.stringify(query));
				Api3.getBargainPage(query).then(body => {
					console.log( body.records);
					_this.tableData = body.records;
					_this.queryParam.total = body.total;
					_this.loading = false;
					if(query.monitor == '01'){
						_this.showMonitor = false;
					}else{
						_this.showMonitor = true;
					}
				})
			},
			handleSizeChange(v) {
				this.loadDatas()
			},
			handleCurrentChange(c) {
				this.loadDatas()
			},
			handleMonitorSizeChange(v) {
				this.loadMonitor()
			},
			handleMonitorCurrentChange(c) {
				this.loadMonitor()
			},
			typeChange(d) {
				//this.loadDatas()
			},
			openWindow(row) {
				row.look = row.id;
				let authCode = atob(localStorage.getItem("uuu"));
				Api3.lookBargain({
					"eid": row.id,
					"authCode": authCode
				})
				window.open(row.link, "_blank")
			},
			openMobileWindow(row) {
				row.look = row.id;
				let authCode = atob(localStorage.getItem("uuu"));
				Api3.lookBargain({
					"eid": row.id,
					"authCode": authCode
				})
				window.open(LinkUtil.pcLinkToMobileLink(row.link), "_blank")
			},
			checkDataBaseNormal() {
				Api.checkDataBaseNormal({}).then(d => {}).catch(e => {
					console.log(e)
				})
			},
			async copy2(event) {
				//获取点击对象
				var el = event.currentTarget;
				let _this = this;
			
				if (el.getAttribute('link')) {
					this.fakeElem = document.createElement('textarea')
					this.fakeElem.value = el.getAttribute('link')
					document.body.appendChild(this.fakeElem)
					this.fakeElem.select()
					if (document.execCommand('Copy')) {
						ElMessage({
							message: '复制手机链接成功.',
							type: 'success',
						})
					} else {
						this.$notify.error('复制手机链接失败')
					}
					if (this.fakeElem) {
						document.body.removeChild(this.fakeElem)
						this.fakeElem = null
					}
				}
			
				if (el.getAttribute('data')) {
					let row = JSON.parse(el.getAttribute('data'));
					this.openMobileWindow(row)
				}
				
			
			
				event.stopPropagation();
			},
		}
	}
</script>

<style>
	.el-table .warning-row {
		background-color: lightgoldenrodyellow
	}

	.el-table .success-row {
		background-color: honeydew;
	}

	.el-table .read-row {
		background-color: lightgoldenrodyellow;
	}

	.el-table td,
	.el-table th {
		padding: 5px 0px;
	}

	.el-table .cell {
		line-height: 14px;
		font-size: 13px;
		/* font-family: Avenir,Helvetica,Arial,sans-serif; */
		font-family: "楷体_GB2312";
	}

	.cell p {
		font-family: "楷体_GB2312";
	}

	.high-light-header {
		color: firebrick;
	}
</style>